package cn.com.dcsgo.api;

import cn.com.dcsgo.service.UserService;
import cn.com.dcsgo.vo.user.LeaderAddressVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * UserApiController
 *
 * @author Dcsgo
 * @since 2025/4/25 7:52
 */
@Api(tags = "用户")
@RestController
@RequestMapping("api/user")
@RequiredArgsConstructor
public class UserApiController {
    private final UserService userService;

    @ApiOperation("根据用户id获取默认自提点信息")
    @GetMapping("deliver/address/{userId}")
    public LeaderAddressVo getDefaultDeliveryAddressByUserId(@PathVariable Long userId) {
        return userService.getLeaderAndDeliveryInfo(userId);
    }
}
